﻿<%@ Page Language="C#" Theme="Samples" AutoEventWireup="true" CodeFile="WebForm5.aspx.cs" Inherits="Samples_Prompt_WebForm5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Sample 5 - Prompt Client Events</title>
    <script type="text/javascript">
        function prompt1_ButtonSelect(sender, args)
        {
            alert('This is the "ButtonSelect" event.');
            alert('You clicked the "' + args.get_button().get_text() + '" button.');
        }
        function prompt1_Show(sender, args)
        {
            alert('This is the "Show" event.');
        }
        function prompt1_Hide(sender, args)
        {
            alert('This is the "Hide" event.');
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server" />
    <div>
        <h2>Prompt Client Events</h2>
        <p>This sample demonstrates the client-side events of the prompt control.</p>
        
        <div>
            <asp:Button ID="button1" Text="Show the Prompt" runat="server" />
        </div>
        
        <ae:Prompt ID="prompt1" Title="Sample 5" Message="I am prompt sample 5." ButtonOptions="Custom" runat="server">
            <ClientEvents>
                <ButtonSelect EventHandler="prompt1_ButtonSelect" />
                <Show EventHandler="prompt1_Show" />
                <Hide EventHandler="prompt1_Hide" />
            </ClientEvents>
            <Buttons>
                <ae:PromptButton ID="yesButton" Text="Yes" runat="server" />
                <ae:PromptButton ID="noButton" Text="No" runat="server" />
                <ae:PromptButton ID="cancelButton" Text="Cancel" runat="server" />
            </Buttons>
            <Triggers>
                <ae:ControlPromptTrigger ControlID="button1" EventName="click" PreventDefault="true" />
            </Triggers>
        </ae:Prompt>
    </div>
    </form>
</body>
</html>
